<template>
  
  <div class="bg1">
    
     <el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column
      label="日期"
      prop="beginDate"
      v-model="tableData.beginDate"
      >
      
    </el-table-column>
        <el-table-column
      label="受助人ID"
      prop="recipientId"
       v-model="tableData.recipientId">
    </el-table-column>
        <el-table-column
      label="项目名称"
      prop="entryName"
       v-model="tableData.entryName">
    </el-table-column>
    <el-table-column
      label="已储金额"
      prop="collectAmount"
       v-model="tableData.collectAmount">
    </el-table-column>
        <el-table-column
      label="目标金额"
      prop="targetAmount"
       v-model="tableData.targetAmount">
    </el-table-column>
     <el-table-column
      label="类型"
      prop="type"
       v-model="tableData.type">
    </el-table-column>
   
  </el-table></div>
 
</template>

<script>
 import axios from 'axios'
  export default {
    data() {
      return {
        searchname:"",
        tableData: {
         
        }, 
       
      }
    },
    created() {
    this.getdata()
  },
    methods: {
        search() {
        let arr= []
        let list =  this.tableData
       console.log(list,'323232');
       if (this.searchname == "") {
           this.getdata()
       }else{
        // console.log(this.searchname);
        for (let i = 0; i < list.length; i++) {
         if (list[i].entryName.indexOf(this.searchname) >= 0) {
         arr.push(list[i])
      }}
        //  console.log(arr,'react');
         this.tableData = arr
       }},
       getdata(){
         axios.get("http://47.106.193.50:8080/entryByFbu").then(res=>{
            let code = res.data.code
            if (code == "200") {
               this.tableData = res.data.data
            }
         })

       },
      handleEdit(index, row) {
        console.log(index, row);
      },
      handleDelete(index, row) {
        console.log(index, row);
      }
    },
  }
</script>
<style scoped>
.bg1{
    width: 90%;
}
.user-search{
  display: flex;
  align-content: center;
  justify-content: center;
}
</style>